<template>
    <div>
<!--        {{children_message}}-->
        <Child ref="child1" message="孩子收到了爸爸的消息..." @receiveMessage="receiveMessage">
            <div slot="slot1">{{children_message}}</div>
            <template v-slot:scope_slot="c">{{c.childData2}}</template>
        </Child>
    </div>
</template>

<script>import Child from "./Child_Component";

export default {
    name: "Father_Component",
    components: {
        Child
    },
    data() {
        return {
            children_message: '爸爸还没收到孩子消息...'
        }
    },
    methods: {
        receiveMessage(message) {
            this.children_message = message
        }
    },
    mounted() {
        console.log(this.$refs.child1.childData)
    }
}
</script>

<style scoped>

</style>
